package com.service;

import com.dao.FileDao;
import com.pojo.Files;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;


@Service
public class FileService {
@Resource
    private FileDao dao;

public int addFile(Files files) throws SQLException {
    return dao.addFileInfo(files);
}
public List<Files> findFiles(int pageIndex,int pageSize) throws SQLException {
    return dao.findFiles(pageIndex, pageSize);
}
public int countAll(String fileName){
    return dao.countAll(fileName);
}
public Files findById(Integer id){
    return dao.findById(id);
}
public List<Files> findFileByName(int pageIndex,int pageSize,String fileName) throws SQLException{
    return dao.findFileByName(pageIndex, pageSize, fileName);
}
/*删除*/
    public int deleteFiles(int id){
        return dao.deleteFiles(id);
    }
}
